<?
$sort = extractStringWithKeyFromArray("sorts", $_GET);
$sort = (($sort && $sort != "clear") ? $sort: "title");
$addfileNo = FILE_ADD_QUICK_LINKS;
?>
<div id="cms_browse_heading" class="cms_browse_heading">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
	  <td valign="top" align="left"><h1>Browse CMS Quick Links</h1></td>
	  <td align="right" valign="top">
	    <form method="post" action="/cms/html/index.php">
		  <input type="hidden" name="fileNo" value="<?=$addfileNo;?>" />
		  <input type="hidden" name="formId" value="193"/>
		  <input type="image" src="/cms/images/cnt_add_new_record.gif" />
		</form>
	  </td>
	</tr>
  </table>
</div>
<div id="cms_browse_topdivider" class="cms_browse_divider"></div>
<div id="cms_browse">
  <table width="100%" class="cms_browsetext"  border="0" cellspacing="0" cellpadding="0">
    <tr >
	  <th align="left" width="45"><a href="/cms/html/index.php?fileNo=<?=FILE_BROWSE_QUICK_LINKS;?>&formid=193&sorts=documentcode&direction=ASC">Id</a></th>
	  <th align="left" width="70"><a href="/cms/html/index.php?fileNo=<?=FILE_BROWSE_QUICK_LINKS;?>&formid=193&sorts=datelogged&direction=ASC">Entered</a></th>
	  <th align="left" ><a href="/cms/html/index.php?fileNo=<?=FILE_BROWSE_QUICK_LINKS;?>&formid=193&sorts=title&direction=ASC">Title</a></th>
	  <th align="left" width="15">&nbsp;</th>
	  <th align="left" width="75">Action</th>
	  <th align="left" width="1"></th>
	</tr>
	<tr>
	  <td colspan="5" align="left"> 
	    <img height="7" src="/cms/images/greyline.gif"  width="100%" />
	  </td>
	</tr>
	<?
	$cmsDocument->flush();
	$cmsDocument->addDocumentType("docCMSQuLink");
	if (!permissionForMode($authInfo->uid, CMS_GROUP_ADMIN, $db)) {
		$cmsDocument->addConstraint("organisationalname", $authInfo->uid);
	}
	$cmsDocument->addSort($sort);
	$cmsDocument->resetIterator();
	while ($row = $cmsDocument->nextDocument()) {
	?>
	<tr>
	  <td width="45" class="cms_browsetext"><?= $row->documentcode; ?></td>
	  <td width="70" class="cms_browsetext"><?= ($row->datelogged ? date("d-m-y", strtotime($row->datelogged)): ""); ?></td>
	  <td class="cms_browsetext"><?= magicClean($row->title); ?></td>
	  <td width="15">
	    <img src="/cms/images/cnt_inactive.gif" width="10" height="10">
	  </td>
	  <td width="75" class="cms_browsetext">
	    <a href="/cms/html/index.php?fileNo=<?=$addfileNo;?>&documentCode=<?= $row->documentcode; ?>" >Edit</a> / 
		<a href="/cms/html/index.php?fileNo=4&documentCode=<?= $row->documentcode; ?>&returnURLEncoded=<?= urlencode("/cms/html/index.php?fileNo=".FILE_BROWSE_QUICK_LINKS."&formid=193"); ?>" >Delete</a>
	  </td>
	  <td><img src="/cms/images/spacer.gif" width="1" height="20" /></td>
	</tr>
	<tr>
	  <td colspan="5" align="left">
	    <img height="7" src="/cms/images/greyline.gif"  width="100%" />
	  </td>
	</tr>
	<?
	}
	?>
  </table>
</div>
